home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / a-storio.adb < prev    next >
Text File  |  1996-01-30  |  3KB  |  55 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                       A D A . S T O R A G E _ I O                        --
  6. --                                                                          --
  7. --                                 B o d y                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.6 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. with System.Address_To_Access_Conversions;
  27.  
  28. package body Ada.Storage_IO is
  29.  
  30.    package Element_Ops is new
  31.      System.Address_To_Access_Conversions (Element_Type);
  32.  
  33.    ----------
  34.    -- Read --
  35.    ----------
  36.  
  37.    procedure Read (Buffer : in  Buffer_Type; Item : out Element_Type) is
  38.    begin
  39.       Element_Ops.To_Pointer (Item'Address).all :=
  40.         Element_Ops.To_Pointer (Buffer'Address).all;
  41.    end Read;
  42.  
  43.  
  44.    -----------
  45.    -- Write --
  46.    -----------
  47.  
  48.    procedure Write (Buffer : out Buffer_Type; Item : in  Element_Type) is
  49.    begin
  50.       Element_Ops.To_Pointer (Buffer'Address).all :=
  51.         Element_Ops.To_Pointer (Item'Address).all;
  52.    end Write;
  53.  
  54. end Ada.Storage_IO;
  55.